/*
 ============================================================================
 Name        : hev-server.h
 Author      : Heiher <admin@heiher.info>
 Version     : 0.0.2
 Copyright   : Copyright (c) 2010 everyone.
 Description : Linkage 802.1x for Unix-like operating system.
 ============================================================================
 */

#ifndef __HEV_SERVER_H__
#define __HEV_SERVER_H__

#include <gio/gio.h>

G_BEGIN_DECLS

#define HEV_TYPE_SERVER	(hev_server_get_type())
#define HEV_SERVER(obj)	(G_TYPE_CHECK_INSTANCE_CAST((obj), HEV_TYPE_SERVER, HevServer))
#define HEV_IS_SERVER(obj)	(G_TYPE_CHECK_INSTANCE_TYPE((obj), HEV_TYPE_SERVER))
#define HEV_SERVER_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST((klass), HEV_TYPE_SERVER, HevServerClass))
#define HEV_IS_SERVER_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), HEV_TYPE_SERVER))
#define HEV_SERVER_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), HEV_TYPE_SERVER, HevServerClass))

typedef struct _HevServer HevServer;
typedef struct _HevServerClass HevServerClass;
typedef enum
{
	HEV_SERVER_NULL,
	HEV_SERVER_FINDING_SERVER,
	HEV_SERVER_AUTH_ACCOUNT_NAME,
	HEV_SERVER_AUTH_ACCOUNT_PASSWD,
	HEV_SERVER_AUTH_SUCC,
	HEV_SERVER_AUTH_FAIL_FINDING_SERVER,
	HEV_SERVER_AUTH_FAIL_ACCOUNT_NAME,
	HEV_SERVER_AUTH_FAIL_ACCOUNT_PASSWD,
	HEV_SERVER_AUTH_FAIL_SUCC,
	HEV_SERVER_TIMEOUT
}HevServerState;

struct _HevServer
{
	GObject parent_instance;
};

struct _HevServerClass
{
	GObjectClass parent_class;

	/* signals START */
	void (*state_changed)(HevServer * self, gint state);
	/* signals END */
};

GType hev_server_get_type(void);

GObject * hev_server_new(GCancellable * cancellable, GError ** error);
gint hev_server_start(HevServer * self);
void hev_server_stop(HevServer * self);


G_END_DECLS

#endif /* __HEV_SERVER_H__ */

